package robotleMvc.frameworks
{
	import flash.display.DisplayObjectContainer;
	import flash.display.LineScaleMode;
	import flash.display.MovieClip;
	
	import org.robotlegs.base.ContextEvent;
	import org.robotlegs.mvcs.Context;
	
	import robotleMvc.frameworks.ambience.AmbienceModel;
	import robotleMvc.frameworks.build.BuildMediator;
	import robotleMvc.frameworks.build.model.BuildModel;
	import robotleMvc.frameworks.glass.GlassMeddiator;
	import robotleMvc.frameworks.ground.GroundMediator;
	import robotleMvc.frameworks.ground.model.GroundModel;
	import robotleMvc.frameworks.lightscene.LightsceneModel;
	import robotleMvc.frameworks.lizhi.LizhiMediator;
	import robotleMvc.frameworks.lizhi.fensan.FensanMediator;
	import robotleMvc.frameworks.scene3D.Scene3DMediator;
	import robotleMvc.frameworks.scene3D.model.Scene3DModel;
	import robotleMvc.frameworks.system.StartUpCompleteCmd;
	import robotleMvc.frameworks.tieXiao.TieXiaoMediator;
	import robotleMvc.frameworks.tree.TreeMediator;
	import robotleMvc.frameworks.tree.TreeModel;
	import robotleMvc.frameworks.uiContainers.UiContainerMediator;
	import robotleMvc.ui.Ground.GroundView;
	import robotleMvc.ui.build.BuildView;
	import robotleMvc.ui.glass.GlassView;
	import robotleMvc.ui.lizhi.LizhiView;
	import robotleMvc.ui.lizhi.fensan.FensanModel;
	import robotleMvc.ui.lizhi.fensan.FensanView;
	import robotleMvc.ui.scene3D.Scene3DView;
	import robotleMvc.ui.tieXiao.TieXiaoView;
	import robotleMvc.ui.tree.TreeView;
	import robotleMvc.ui.uiContainers.UiContainer;

	// --------------MSN:lation_pan@live.cn  QQ: 3423526------------- //
	public class AppContext extends Context
	{
		private var game:MovieClip;
		public function AppContext(contextView:DisplayObjectContainer=null, autoStartup:Boolean=true)
		{
			super(contextView, autoStartup);
			game = contextView as MovieClip;
		}
		override public function startup():void
		{
			mapModel();
			mapView();
			mapCommand();
			mapService();
			super.startup();
		}
		private function mapService():void
		{
			
		}
		private function mapCommand():void
		{
			commandMap.mapEvent( ContextEvent.STARTUP_COMPLETE, StartUpCompleteCmd, ContextEvent, true );
		}
		private function mapView():void
		{
			mediatorMap.mapView( UiContainer, UiContainerMediator );
			mediatorMap.mapView( Scene3DView, Scene3DMediator );

		}
		private function mapModel():void
		{
			injector.mapSingleton( Scene3DModel );
		}
	}
}